<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <base href="${request.contextPath}/"/>
    <meta name=”renderer” content=”webkit|ie-comp|ie-stand”/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <link rel="icon" href="favicon.ico">

    <title>公司添加|凌之迅信息|快速开发平台|Learun敏捷开发框架</title>
    <link href="Content/font/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="Content/bootstrap/bootstrap.min.css" rel="stylesheet"/>
    <link href="Content/view/form.css" rel="stylesheet"/>

    <style></style>
    <script src="Content/jquery/jquery-1.10.2.min.js"></script>
    <script src="Content/jquery/jquery.md5.min.js"></script>
    <script src="Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script>
    <script src="Content/laydate/laydate.js"></script>

    <script src="Content/ueditor/ueditor.config.js"></script>
    <script src="Content/ueditor/ueditor.all.min.js"></script>
    <script src="Content/ueditor/lang/zh-cn/zh-cn.js"></script>

    <!--[if lt IE 9]>
    <script src="~/Content/bootstrap/html5shiv.min.js"></script>
    <script src="~/Content/bootstrap/respond.min.js"></script>
    <![endif]-->

    <style>

        /*去除百度地图版权*/
        .anchorBL {
            display: none;
        }
    </style>

    <script>
        //   *LaoNa* 写后台的地址，底下直接饮用
        var controlUrl = '/pccontrol/home/party/map';

        function request(d) {
            for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) {
                var b = c[a].split("=");
                if (b[0] == d) if ("undefined" == unescape(b[1])) break; else return unescape(b[1])
            }
            return ""
        };
    </script>

</head>

<body class="Firefox 63.0 lr-uitheme-default">
<div id="lr_form_bg" class="lr-form-bg">
</div>


<div class="lr-form-wrap" id="form">
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">组织名称<font face="宋体">*</font>
        </div>
        <input id="partyname" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">负责人<font face="宋体">*</font>
        </div>
        <input id="people" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">联系电话<font face="宋体">*</font>
        </div>
        <input id="phone" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">地址<font face="宋体">*</font></div>
        <input id="address" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">经度<font face="宋体">*</font></div>
        <input id="lon" type="text" class="form-control" readonly="readonly" value="122.54592335559218" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">纬度<font face="宋体">*</font>
        </div>
        <input id="lat" type="text" class="form-control" readonly="readonly" value="52.979069538529444" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <center>
        <div class="" style="width: 90%;height: 300px;" id="container">
        </div>
    </center>
</div>

<script>
    var acceptClick;
    var keyValue = "";
    var flag;
    var maplon = "122.54592335559218"
    var maplat = "52.979069538529444";

    var bootstrap = function (a, b) {
        var d = b.frameTab.currentIframe().selectedRow;
        flag = b.frameTab.currentIframe().flag;
        var c = {
            init: function () {
                c.bind();
                c.initData()
            },
            bind: function () {

            },
            initData: function () {
                if (!!d) {
                    keyValue = d.id;
                    a("#form").lrSetFormData(d);
                    window.maplon = d.lon;
                    window.maplat = d.lat;
                    creatMap();
                }
                if (flag == "query") {
                    $("#partyname").prop("readonly", "readonly");
                    $("#people").prop("readonly", "readonly");
                    $("#phone").prop("readonly", "readonly");
                    $("#address").prop("readonly", "readonly");
                    $("#lon").prop("readonly", "readonly");
                    $("#lat").prop("readonly", "readonly");
                    marker.disableDragging();
                }
                if (flag == "add") {
                    creatMap();
                }
            }
        };
        acceptClick = function (e) {
            if (!a("#form").lrValidform()) {
                return false
            }
            var f = a("#form").lrGetFormData(keyValue);
            if (f.parentId == "" || f.parentId == "&nbsp;") {
                f.parentId = "0"
            }
            f.nature = "Circulationsolicit"
            a.lrSaveForm(top.$.rootUrl + controlUrl + "/SaveForm?keyValue=" + keyValue, f, function (g) {
                if (!!e) {
                    e()
                }
            })
        };
        c.init()
    };
</script>
<script src="Content/view/form.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=gaymbGh1STIIT2CnWGahmdG7fCXk4nT1"></script>
<script>
    function creatMap() {
        //*LaoNa 百度地图*
        var map = new BMap.Map("container");
        var point = new BMap.Point(maplon, maplat);
        map.centerAndZoom(point, 15);
        var marker = new BMap.Marker(point);
        var myIcon = new BMap.Icon("Content/pccontrol/img/mapico.png", new BMap.Size(50, 50), {
            anchor: new BMap.Size(10, 50),
            imageOffset: new BMap.Size(0, 0) // 设置图片偏移
        });
        marker.enableDragging();
        window.marker = marker;
        marker.setIcon(myIcon);
        map.addOverlay(marker);
        map.enableDragging();
        var opts = {
            type: BMAP_NAVIGATION_CONTROL_SMALL
        }
        map.addControl(new BMap.NavigationControl(opts));
        marker.addEventListener("dragend", function () {
            var curPoint = marker.getPosition();
            $("#lon").val(curPoint.lng);
            $("#lat").val(curPoint.lat);
        });

    }
</script>
</body>

</html>